Jump To:
Technical Q&As
Cocoa is an object-oriented application environment designed specifically for developing Mac OS X native applications. The Cocoa frameworks support rapid development and high productivity, and include a full-featured set of classes designed to create robust and powerful Mac OS X applications. Cocoa provides developers starting new Mac OS X projects the fastest way to full-featured, extensible, and maintainable implementations. Applications from UNIX and other platforms can also be brought to Mac OS X quickly by using Cocoa to build state-of-the-art Aqua user interfaces while retaining most existing core code.

Cocoa Resources
A guided introduction and learning path for developers new to Cocoa.   Essential information for developers using Objective-C and Java.   Objective-C and Java programming specifications, organized by framework.
Document Descriptions
On Off
Display

Sorted by
Title
Sort by
Topic
Sort by
Date
Allocate and Disk Full Error (HTML) ()
FL12: Discusses a problem with AFP volumes displaying incorrect free space, and returning disk full errors.
Networking 1999-07-21
Avoiding the -42 error with DiscRecording (HTML)
QA1292: Explains how to workaround the -42 error when using the DiscRecording API.
File Management 2004-05-25
Background-only apps with NSStatusItems become active in 10.1 on NSStatusItem clicks (HTML)
QA1081: Preventing background-only apps from activating when their NSStatusItem(s) are clicked in Mac OS X 10.1.
Events & Other Input, User Experience 2001-10-30
BOM characters in 'utxt' clipboard flavor (HTML) ()
QA1221: Explains the use of the BOM character in 'utxt' scrap data
Data Management, Interapplication Communication 2003-01-20
Calling an AppleScript and providing parameters from an Application (HTML) ()
QA1111: Explains calling and providing parameter values to an AppleScript event handler from an application written in C.
AppleScript 2002-03-13
CFXML to CFPropertyListRef (and back!) (HTML) ()
QA1208: Describes to how save and restore a CFPropertyListRef to and from an XML file.
Data Management 2003-08-29
CGBitmapContextCreate Supported Color Spaces (HTML)
QA1037: Lists the color space and alpha info combinations currently supported by CGBitmapContextCreate.
Games, Graphics & Imaging 2004-09-09
CGContext Bounds (HTML)
QA1048: Explains how to determine the bounds of a CGContext.
Graphics & Imaging, Printing 2001-07-02
CGContextAddLineToPoint, CGContextAddCurveToPoint, et. al. (HTML)
QA1049: Explains why the CGContextAddXYZ APIs don't draw anything immediately.
Graphics & Imaging, Printing 2001-07-02
CGContextClosePath (HTML)
QA1046: Explains when you should call CGContextClosePath.
Graphics & Imaging, Printing 2001-10-02
CGImageRef contents are immutable (HTML) ()
QA1276: Explains that CGImageRef contents are considered immutable once created.
Graphics & Imaging 2003-07-17
Changing the TCP Window Size (HTML)
NW47: Describes how to change the TCP window size in Open Transport.
Networking 1997-03-14
Comparing selectors in Cocoa-Java code (HTML)
QA1069: Explains why Objective-C and Java selectors appear to be the same name but equality tests fail.
Java 2001-08-31
Converting Simplified Chinese (HTML) ()
TX06: Describes how to convert Macintosh Simplified Chinese encoding into GB2312.
Text & Fonts 1996-02-09
Converting to Precomposed Unicode (HTML) ()
QA1235: Describes how to convert a string to precomposed Unicode.
Internationalization, Text & Fonts 2003-02-07
Debugging Graphics with QuartzDebug (HTML) ()
QA1236: Explains how to use QuartzDebug to debug graphics issues.
Graphics & Imaging 2003-02-25
Detecting specific ROM-in-RAM Mac (HTML) ()
Deprecated - HW49: Identifying a Mac by name ("iMac"), and better alternatives for determining specific features ("has Firewire").
Design Guidelines, Runtime Architecture 1999-10-05
Determining user login/logout status (HTML)
QA1133: Tells how to determinine if a user is logged in, and how to get login/logout notification
Process Management, Resource Management 2002-04-08
Developing for VFS (HTML) ()
QA1242: Describes Apple's position on developing external file systems (VFS plug-ins) for Mac OS X.
File Management 2003-03-26
Disabling a Processor on a Multiprocessor System (HTML) ()
QA1141: Describes how to disable a processor on a multiprocessor system for testing purposes.
Performance 2002-05-22
Discovering all advertised Rendezvous service types (HTML)
QA1337: Explains how to discover all Rendezvous service types being advertised on the local network.
Networking 2004-06-01
Don't forget to cancel your Rendezvous resolve (HTML)
QA1297: Explains why it's important to cancel a Rendezvous resolve operation.
Networking 2003-10-15
Downloading through a proxy server in Mac OS X (HTML)
QA1296: Explains when downloading through a proxy server will work, and when it will fail.
Networking 2003-10-29
Drawing a Path Multiple Times (HTML)
QA1047: Explains that path drawing operations consume the path.
Graphics & Imaging, Printing 2001-07-02
Environment Variables (HTML)
QA1255: Describes how a process gets its environment variables.
Runtime Architecture 2003-10-29
Finding an NSView's current magnification. (HTML)
QA1346: How to discover the current magnification (zoom level) of any NSView.
Graphics & Imaging, User Experience 2004-12-13
FSSetCatalogInfo versus UID and GID (HTML) ()
QA1251: Describes why FSSetCatalogInfo does not set the UID and GID of the file, and provides a work around.
File Management 2003-03-26
Getting a Packet Trace (HTML) ()
QA1176: Lists tools available for looking at the network packets on the wire.
Internet & Web, Networking 2004-07-13
Getting NSWindow's toolbar actions to show up in Interface Builder (HTML)
QA1030: How to add the missing -toggleToolbarShown: and -runToolbarCustomizationPalette actions to Interface Builder.
Tools, User Experience 2001-05-03
Graphics Exporters - Creating 16-bit-per-channel image files (HTML)
QA1354: Discusses how to use QuickTime Graphics Exporters to create 16-bit-per-channel image files.
QuickTime 2004-06-03
How can I programmatically determine the DPI of the current video mode? (HTML) ()
QA1217: Describes how to compute the DPI for a given display in a given mode using Core Graphics.
Games, Graphics & Imaging 2002-12-02
How do I determine how much VRAM is available on my video card? (HTML)
QA1168: Using Core Graphics and IOKit to find the physical size of VRAM on installed hardware.
Graphics & Imaging 2004-10-11
How do I tell if a particular display is being hardware accelerated by Quartz Extreme? (HTML) ()
QA1218: Describes how to use CGDisplayUsesOpenGLAcceleration to see if a display is accelerated or not.
Games, Graphics & Imaging, Performance 2002-12-04
How to add other pasteboard types to an HFS Promise drag in Cocoa (HTML)
QA1300: Explains how to add other pasteboard types to an HFS Promise drag in Cocoa.
Interapplication Communication 2003-09-15
How to get custom views to show up in NSToolbarItems (HTML)
QA1029: Why custom views may not show up in an NSToolBarItem and how to make it visible.
User Experience 2001-05-03
How to measure CG text (HTML)
QA1051: Explains how to measure Core Graphics text.
Graphics & Imaging, Printing 2001-07-02
How to remove the "Open Recent" menu item in a Document-based Cocoa application (HTML)
QA1289: Explains how to remove the "Open Recent" menu item in a Document-based Cocoa application.
User Experience 2003-09-15
How to set a custom drag image when doing an HFS Promise drag in Cocoa (HTML)
QA1200: Explains how to set a custom drag image when doing an HFS Promise drag in Cocoa.
Interapplication Communication, User Experience 2003-09-15
Is ColorSync thread safe? (HTML) ()
QA1261: Discusses ColorSync thread-safety issues.
Graphics & Imaging 2003-04-17
Is QuickTime thread-safe? (HTML)
QA1088: Discusses thread-safety and reentrancy of the QuickTime library on both Mac & Windows.
Design Guidelines, Process Management 2001-11-01
Movies - Saving movie playback hints (HTML)
QA1366: Explains how to save and load media play hints from Movie files.
QuickTime 2004-09-14
NSOpenGLView redraw problems after a window is closed and re-opened. (HTML)
QA1353: Workaround for NSOpenGLView failure to draw after its window is closed and re-opened.
Graphics & Imaging 2004-12-03
NSTimers and Rendering Loops (HTML)
QA1385: Using Cocoa timers (NSTimer) to drive a rendering loop
Events & Other Input, Games, Graphics & Imaging 2004-10-04
OpenGL Sample Code (HTML)
QA1166: Describes new naming convention for OpenGL sample code
Games, Graphics & Imaging 2004-12-01
Power Management; Policy Maker vs. Power Controller (HTML) ()
QA1121: Describes the differences between a Power Management Policy Maker and a Power Management Power Controller.
Events & Other Input 2002-02-13
PPPoE Server for Testing (HTML) ()
QA1252: Describes how to configure Mac OS X as a PPPoE server for testing purposes.
Networking 2003-04-11
Preventing crashes when using multiple disabled but editable NSComboBoxes (HTML) ()
QA1142: How to prevent a crash when using multiple disabled -- but editable --NSComboBoxes in a view.
User Experience 2002-06-03
Preventing sleep (HTML)
QA1160: Explains how your application can prevent the system from sleeping.
Resource Management 2004-10-22
Programmatically causing restart, shutdown and/or logout (HTML) ()
QA1134: Describes how to programmatically cause restart, shutdown, sleep or logout.
Events & Other Input, Process Management, Resource Management 2003-02-10
Quartz 2D Interpolation (HTML) ()
QA1186: Explains how to control Quartz 2D's image interpolation.
Graphics & Imaging, Printing 2002-10-29
Quartz 2D Thread Safety (HTML) ()
QA1238: Explains the thread-safety issues for the Quartz 2D API.
Graphics & Imaging, Performance, Printing 2003-02-25
Re-enabling dragging from NSTableView to other applications (HTML) ()
QA1220: Explains how to re-enable drag-and-drop from NSTableViews to other applications
Interapplication Communication, User Experience 2002-12-02
Registering for sleep notifications (HTML)
QA1340: Explains how register for sleep notifcations on Mac OS X.
Resource Management 2004-10-25
Rendezvous and wake from sleep (HTML)
QA1290: Explains why applications that use Rendezvous should stay registered and continue browsing on sleep.
Networking 2003-09-18
Rendezvous enforces the service type format in Panther (HTML)
QA1198: Explains why registering a Rendezvous service might fail on Panther.
Networking 2004-03-23
Rendezvous enforces the TXT record format in Panther (HTML)
QA1306: Explains how mDNSResponder enforces the proper TXT record format in Panther.
Networking 2004-07-14
The Rendezvous Name is not the Rendezvous name (HTML) ()
QA1228: Explains why you should use the Computer Name when advertising a Rendezvous service.
Networking 2004-03-05
Rendezvous TXT record rate limiting in Panther (HTML)
QA1293: Explains how mDNSResponder implements TXT record rate limiting in Panther.
Networking 2003-10-23
Resolves may return an IPv6 address in Panther (HTML)
QA1298: Explains why you get an IP address of 0.0.0.0 when resolving a Rendezvous service.
Networking 2005-01-10
Saving the current Core Graphics Path (HTML)
QA1056: Explains that the Core Graphics save and restore GState APIs do not affect the path.
Graphics & Imaging, Printing 2001-10-02
SCSIAction and IOSCSIUserClient on Mac OS X 10.2 (HTML) ()
QA1201: Describes migrating to a new API for SCSI Parallel devices starting with Mac OS X 10.2.
Printing 2002-09-13
Sending an Email (HTML)
QA1084: Shows how to create an email in the user's prefered email application.
Interapplication Communication, Internet & Web, Networking 2004-11-05
Setting environment variables for user processes (HTML)
QA1067: Tells how to set environment variables for user processes.
Data Management, Games, Porting, Runtime Architecture, Tools 2001-10-25
Setting the ColorSync profile for a NSBitmapImageRep object (HTML)
QA1369: Setting the ColorSync profile for a NSBitmapImageRep object
Graphics & Imaging 2004-09-08
Setting the preferred CMM programatically? (HTML)
QA1086: Uses the NCMConcatProfileSet structure to specify the CMM to be used to make the CMWorldRef with the NCWConcatColorWorld function.
Graphics & Imaging 2001-10-24
Shearing a Coordinate Space with NSAffineTransform (HTML) ()
QA1332: Describes a simple way to shear coordinate spaces by adding a few methods to the NSAffineTransform class.
Graphics & Imaging 2004-01-29
Solving NSTabView drawing problems in Mac OS X 10.1.x (HTML) ()
QA1117: Explains how to work around NSTabView draw problems in Mac OS X 10.1.x
User Experience 2002-02-14
Sorting Like the Finder (HTML)
QA1159: Shows how to sort strings like the Finder's list view.
File Management, Text & Fonts 2004-10-27
Static linking of user binaries on Mac OS X (HTML) ()
QA1118: Explains why static linking of user binaries is not supported on Mac OS X, and possible workarounds.
Runtime Architecture 2002-02-07
Suppressing the "unexpectedly quit" alert (HTML)
QA1288: Describes how to suppress the "unexpectedly quit" alert.
User Experience 2003-10-10
T_DATA_REQ vs M_DATA TPI Message Blocks (HTML) ()
NW42: Explains why OT passes data to a TPI module using M_DATA message blocks instead of M_PROTO+T_DATA_REQ.
Networking 1996-10-25
Third party VFS can't unmount on Mac OS X 10.3 (HTML)
QA1308: Describes changes in unmounting behavior for VFS plug-ins under Mac OS X 10.3 "Panther."
File Management 2003-10-23
Timely Issues - 1904 (HTML) ()
OPS23: Explains why the beginning of the year 1904 was chosen for epoch of the Time global variable.
Resource Management 1999-05-17
Turning Off Core Graphics Clipping (HTML)
QA1050: Explains how to clear the clipping path for a CGContext.
Graphics & Imaging, Printing 2001-07-02
Unexpected CG state changes (HTML)
QA1045: Explains why the Core Graphics drawing state sometimes changes for no apparent reason.
Graphics & Imaging, Printing 2001-07-02
Updating the TXT record of a Rendezvous service (HTML)
QA1302: Explains how to update a Rendezvous TXT record while running on either Jaguar or Panther.
Networking 2004-07-14
Using Interface Builder's NSOpenGLView or Custom View objects for an OpenGL application (HTML)
QA1167: Describes usage cases for both NSOpenGLViews and Custom Views for Cocoa OpenGL applications
Graphics & Imaging 2004-10-28
Variable arguments in Objective-C methods (HTML)
QA1405: How to implement methods which take a variable number of arguments.
Objective-C Language 2005-01-13
Why aren't my tracking rects working? (HTML)
QA1355: Describes a common mistake in setting up cursor-tracking rectangles.
Events & Other Input, User Experience 2004-12-02
Why does -stringByTrimmingCharactersInSet: give me an empty string result when it shouldn't? (HTML) ()
QA1202: Why -stringByTrimmingCharactersInSet: sometimes returns an empty string result in Mac OS X 10.2.x when it shouldn't.
Data Management 2002-10-15